import axios from "../axios";
import apiList from "./api-list";
import type { ProductPartDTO, ProductPartVO } from "./types";

class ProductPartController {
    create(data: ProductPartVO) {
        return axios.post(apiList.create, data);
    }
    update(data: ProductPartVO) {
        return axios.post(apiList.update, data);
    }
    delete(guid: string) {
        return axios.get(apiList.delete, { guid });
    }
    list(productCode: string) {
        return axios.get<ProductPartDTO[]>(apiList.list, { productCode });
    }
}

export default ProductPartController;